{extend name="layout:base" /}
{block name="page_style"}
  <link rel="stylesheet" href="{$site_root}/static/plugins/umeditor1.2.3/themes/default/css/umeditor.min.css">
{/block}
{block name="page_content"}
  <form id="settings-form" class="form-horizontal" method="post">
    <div class="form-group">
      <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
        是否开启邮箱激活：
      </label>
      <div class="col-sm-9" style="padding-top:5px;">
        <input name="options[email_active]" id="email_open" value="1" class="ace ace-switch ace-switch-4 btn-flat" type="checkbox" <?php if(isset($options["email_active"]) && intval($options["email_active"]) > 0){echo('checked="checked"');} ?> />
        <span class="lbl"></span>
      </div>
    </div>
    <div class="space-4"></div>

    <div class="form-group">
      <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 邮件标题： </label>
      <div class="col-sm-9">
        <input type="text" name="options[email_title]" id="email_title" value="{$options.email_title|default=''}"  class="col-xs-10 col-sm-5" required/>
        <span class="help-inline col-xs-12 col-sm-7">
          <span class="middle" id="restwo"></span>
        </span>
      </div>
    </div>
    <div class="space-4"></div>

    <div class="form-group">
      <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 模板内容： </label>
      <div class="col-sm-8">
        <script id="email_tpl" name="options[email_tpl]" type="text/plain" style="width:100%;height:400px;">
          {$options.email_tpl|default=''}
        </script>
      </div>
    </div>
    <div class="space-4"></div>

    <div class="clearfix form-actions">
      <div class="col-sm-offset-3 col-sm-9">
        <button class="btn btn-info" type="submit">
          <i class="ace-icon fa fa-check bigger-110"></i>
          保存
        </button>

        &nbsp; &nbsp; &nbsp;
        <button class="btn" type="reset">
          <i class="ace-icon fa fa-undo bigger-110"></i>
          重置
        </button>
      </div>
    </div>
  </form>
{/block}
{block name="page_js"}
  <script src="{$site_root}/static/plugins/umeditor1.2.3/umeditor.config.js" type="text/javascript"></script>
  <script src="{$site_root}/static/plugins/umeditor1.2.3/umeditor.min.js" type="text/javascript"></script>
  <script src="{$site_root}/static/plugins/umeditor1.2.3/lang/zh-cn/zh-cn.js" type="text/javascript"></script>
  <script type="text/javascript">
    var um = UM.getEditor("email_tpl", {
                imageUrl: "{:url('index/upload/umeditor')}", //把编辑器的图片上传方法改成TP方法
                imagePath: "", //
                toolbar: ['source | undo redo | bold italic underline strikethrough | forecolor backcolor | removeformat |',
            'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize' ,
            '| justifyleft justifycenter justifyright justifyjustify |',
            'link unlink | emotion image video  | map',
            '| horizontal preview fullscreen']
              });
  </script>
{/block}